package com.tencreat.domain.account;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tencreat.common.annotation.Excel;
import com.tencreat.common.core.domain.BaseEntity;
import com.tencreat.common.enums.UserType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;


/**
 * 提现记录对象 account_withdraw_audit
 *
 * @author tencreat
 * @date 2021-11-25
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
@TableName("account_withdraw_audit")
public class AccountWithdrawAudit extends BaseEntity<AccountWithdrawAudit> {
    private static final long serialVersionUID = 1L;


    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "ID")
    private Long id;


    /**
     * 用户id
     */
    @Excel(name = "用户ID",sort = 1)
    @ApiModelProperty(value = "用户id")
    @TableField("`uuid`")
    private Long uuid;

    @TableField(exist = false)
    @ApiModelProperty(value = "手机号码")
    @Excel(name = "手机号码",sort = 2)
    private String mobile;

    /**
     * 提现类型
     */
    @Excel(name = "提现类型",readConverterExp = "1=微信,2=支付宝,3=银行卡",sort = 5)
    @ApiModelProperty(value = "提现类型 1 微信 2支付宝 3银行卡")
    @TableField("`withdraw_type`")
    private Integer withdrawType;

    /**
     * 金额
     */
    @Excel(name = "提现金额",sort = 4)
    @ApiModelProperty(value = "金额")
    @TableField("`value`")
    private BigDecimal value;


    /**
     * 审核结果 0未审核 1审核通过 2审核失败
     */
    @Excel(name = "提现状态",readConverterExp = "0=未审核,1=审核通过,2=审核失败",sort = 5)
    @ApiModelProperty(value = "审核结果 0未审核 1审核通过 2审核失败")
    @TableField("`result`")
    private Integer result;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("audit_time")
    @ApiModelProperty(value = "审核时间")
    private LocalDateTime auditTime;

    /**
     * 类型 1提现 2代付
     */
    @ApiModelProperty(value = "类型 1提现 2代付")
    @TableField("`type`")
    private Integer type;

    @Excel(name = "申请时间", sort = 7, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("申请时间")
    @TableField(exist = false)
    private LocalDateTime createTime2;



    /**
     * 余额表id
     */
    @ApiModelProperty(value = "余额表id")
    @TableField("`balance_id`")
    private Long balanceId;


    /**
     * 手续费
     */
    @ApiModelProperty(value = "手续费")
    @TableField("`service_money`")
    private BigDecimal serviceMoney;



    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableLogic
    @TableField("`del_flag`")
    private String delFlag;

    @TableField(exist = false)
    @ApiModelProperty(value = "姓名")
    private String name;

    @TableField(exist = false)
    @ApiModelProperty(value = "手机号")
    private String phone;

    @TableField(exist = false)
    @ApiModelProperty(value = "银行名称")
    private String bankName;

    @TableField(exist = false)
    @ApiModelProperty("收款码")
    private String qr;


/*
    */
/**
     * 租户ID
     *//*

    @ApiModelProperty(value = "租户ID")
    @TableField("`tenant_id`")
    private Long tenantId;
*/

    @TableField(exist = false)
    @ApiModelProperty(value = "搜索开始时间")
    private String startTime;
    @TableField(exist = false)
    @ApiModelProperty(value = "搜索结束时间")
    private String endTime;

    @ApiModelProperty(value = "余额")
    @TableField(exist = false)
    private BigDecimal balance;

/*
    @ApiModelProperty(value = "等级")
    @TableField(exist = false)
    @Excel(name = "用户类型",sort = 3, enumType = true)
    private UserType userLevel;
*/

    @ApiModelProperty(value = "提现订单号")
    @TableField("`sn`")
    private String sn;

    @ApiModelProperty(value = "第三方订单号")
    @TableField("`pay_sn`")
    private String paySn;

    @ApiModelProperty(value = "转账备注")
    @TableField("`remarks`")
    private String remarks;

    @ApiModelProperty(value = "到账状态 0-处理中 1-已到账 2-转账失败")
    @TableField("`receipt_status`")
    private Integer receiptStatus;

    @TableField(exist = false)
    @ApiModelProperty(value = "查询次数")
    private Integer queryNum;

    @TableField(exist = false)
    @ApiModelProperty(value = "提现金额")
    private BigDecimal amount;

    @ApiModelProperty(value = "渠道类型")
    @TableField("`channel_type`")
    private Integer channelType;

    @ApiModelProperty(value= "审核原因")
    @TableField("`audit_opinion`")
    private String auditOpinion;
}
